'''
@Company: TWL
@Author: xue jian
@Email: xuejian@kanzhun.com
@Date: 2020-02-23 00:14:05
'''
from typing import List
class Cashier:

    def __init__(self, n: int, discount: int, products: List[int], prices: List[int]):
        self.n_ = n
        self.prices_ = prices
        self.n_count_ = 0
        self.product_prices_ = {}
        for i in range(len(products)):
            self.product_prices_[products[i]] = prices[i]
        
        
    def getBill(self, product: List[int], amount: List[int]) -> float:
        self.n_count_ += 1
        tot_prices = 0
        for i in range(len(product)):
            tot_prices += self.product_prices_[product[i]] * amount[i]
        
        
        if self.n_count_ >= self.n_:
            tot_prices = tot_prices*(1-discount/100)
            self.n_count_ = 0
        return tot_prices
            


obj = Cashier(3,50,[1,2,3,4,5,6,7],[100,200,300,400,300,200,100])
print(obj.getBill([1,2],[1,2]))